package com.fjwt.gz.mgr.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/*
* webmvc配置
*
* @author wg
* @site https://pt.jdyd.xyz/
* @date 2021/6/8 17:12
*/
@Configuration
public class WebmvcConfig implements WebMvcConfigurer {

    @Autowired
    private ApiResInterceptor apiResInterceptor;
    @Autowired
    private LoggingInterceptor loggingInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(apiResInterceptor);
       registry.addInterceptor(loggingInterceptor).excludePathPatterns(
                "/api/anon/**",
                "/api/ossFiles/**",
                "/api/fans/fansLogin",
                "/api/wx/notify",
                "/api/tlpay/notify",
                "/api/mchApplyments/contractObtain",
                "/api/sms/**",
                "/api/scoreRecord/scoreRecordSync",
                "/api/redis/getFile",
                "/api/redis/upFile",
                "/api/redis/redis/getRedisValue",
                "/api/redis/redis/delRedis",
                "/api/redis/redis/setRedisExpireTime",
               "/jmreport/**","/drag/**","/favicon.ico","/error","/swagger-resources/**","/webjars/**","/*/api-docs","/druid/**","/websocket/**"
                );
    }

}
